package com.example.discover_model;

import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewbinding.ViewBinding;
import androidx.viewpager.widget.ViewPager;

import com.example.common.mvvm.view.BaseFragment;
import com.example.discover_model.databinding.FragmentFindBinding;
import com.example.discover_model.entity.DataDTO;
import com.example.discover_model.entity.DataDTOX;
import com.example.discover_model.tabs.AttentionFragment;
import com.example.discover_model.tabs.RecommendFragment;
import com.example.widget_sdk.FindDecoration;
import com.flyco.tablayout.SlidingTabLayout;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class FindFragment extends BaseFragment<FragmentFindBinding,FindViewModel> {



    private SlidingTabLayout findTabLayout;
    private ViewPager findVp;

    @Override
    public View bindLayout() {
        return v.getRoot();
    }

    @Override
    public ViewBinding initBind() {
        return FragmentFindBinding.inflate(inflater);
    }

    @Override
    public void initView() {
//        findRecycler = v.findRecycler;
        findTabLayout = v.findTabLayout;
        findVp = v.findVp;
        ArrayList<Fragment> fragments = new ArrayList<>();
        AttentionFragment attentionFragment = new AttentionFragment();
        RecommendFragment recommendFragment = new RecommendFragment();
        fragments.add(attentionFragment);
        fragments.add(recommendFragment);
        findTabLayout.setViewPager(findVp,new String[]{"关注","推荐"} ,getActivity(),fragments);
        findTabLayout.setTextUnselectColor(Color.BLACK);
        findTabLayout.setTextSelectColor(Color.RED);
    }

    @Override
    public void initData() {

    }


    @Override
    public void receiveData(Map<String, Object> data) {

    }
}
